import { useLocation } from "react-router";

export function useQuery() {
  const location = useLocation()
  const query= new URLSearchParams(location.search)
  return [...query].reduce((obj, [key, value]) => {
    obj[key] = value
    return obj
  }, {})
}